package excise;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

/**
 * @author CoderXshuai
 */
public class ForkAndJoin {
    public static void main(String[] args) {
        ForkJoinPool pool = new ForkJoinPool();
        PrimThread primThread = new PrimThread(1, 100000L);
        ForkJoinTask<Long> task = pool.submit(primThread);
        long result = 0;
        try {
            result = task.get();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(primThread.getTime());
        System.out.println(result);
    }
}
